// yb_mingpian/pages/shopDetail/detail/detail.js
var tget = getApp(),
  core = tget.requirejs("core"),
  e = tget.requirejs("check");
Page({

  /**
   * 页面的初始数据
   */
  data: {
    shopInfo: {
      store_id: 19,
      uid: 267,
      license: "http://sssssss.com/asasas.png",
      company: "福建品上茶城有限公司",
      category: "餐饮",
      tel: "13822200111",
      province: "福建省",
      city: "福州市",
      county: "仓山区",
      address: "浦上大道208号",
      link: "石乐志",
      store_name: "安溪白茶",
      logo: 'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1600578735543&di=195e6c89b9aa08308c68facc96badd25&imgtype=0&src=http%3A%2F%2Fimg7.ddove.com%2Fupload%2F20180907%2F172333945605.jpg',
      sale: "4",
      date: "2020-09-19",
      slogan: "世界白茶精品",
      favorites: false
    },
    shopDesc: [
      { name: '店铺标语',  val: '世界白茶在中国，中国白茶在福鼎世界白茶在中国，中国白茶在福鼎'},
      { name: '所在地区',  val: '福建省宁德市'},
      { name: '开店时间',  val: '20190311'},
    ]
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) { 
    console.log(options)
    let that = this
    core.get("store/detail", {
      store_id:options.id,
      uid: tget.getCache("userinfo").uid
    }, function (a) {
      console.log('商品', a)
      if (a.code == 0) {
        that.setData({
          shopInfo: a.info
        })
      } else {
        core.alert(a.msg)
      }

    })
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})